package com.by.config;

import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.lang.ref.SoftReference;
import java.util.HashMap;
import java.util.Map;

/**
 * @author ServivE
 * @version 0.1
 * @className RabbitConfig
 * @description
 * @date 2024/10/23 9:17
 * @since jdk17
 */
@Configuration
public class RabbitConfig {
    @Bean
    public Queue queue() {
        Map<String, Object> arg = new HashMap<>();
        arg.put("x-message-ttl", 5000);//消息的生命周期
        return new Queue("hello", true, false, false, arg);
    }
}
